package top.lingchen.spring5.factorybean;

import org.springframework.beans.factory.FactoryBean;
import top.lingchen.spring5.collectiontype.Course;

/**
 * @Author 凌宸
 * @create 2021-11-28 下午 7:43
 * @Description
 * @Version 1.0
 */
public class MyBean implements FactoryBean<Course> {

    // 定义返回 bean
    @Override
    public Course getObject() throws Exception {
        Course course = new Course();
        course.setCourseName("Spring 5");
        return course;
    }

    @Override
    public Class<?> getObjectType() {
        return null;
    }

    @Override
    public boolean isSingleton() {
        return FactoryBean.super.isSingleton();
    }
}
